with open("file.txt") as file_in:
lines = []
for line in file_in:
lines.append(line)
with open(fname) as f:
content = f.read().splitlines()
# Program to read all the lines in a file using readline() function
file = open("python.txt", "r")
while True:
content=file.readline()
if not content:
break
print(content)
file.close()